package com.qf.commo.exception;

import com.qf.commo.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class RbacExceptionHandler {
    @ExceptionHandler(Exception.class)
    public R systemException(Exception e){
        log.error("这是系统异常",e);
        return R.error();
    }
    @ExceptionHandler(RbacException.class)
    public R rbacException(RbacException r){
        R error = R.error();
        error.put("msg",r.getMsg());
        return error;
    }
}
